home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr47 / asmlib40.zip / MODE.DOC < prev    next >
Text File  |  1994-05-04  |  15KB  |  402 lines

  1.  
  2. ****************************  VIDEO MODES  ***********************************
  3.  
  4. ASMLIB video mode subroutines (C) Copyright 1991 - 1994 Douglas Herr
  5. All rights reserved
  6.  
  7. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  8.  
  9. HGRAPH:      establishes Hercules graphics mode, pages 0 & 1
  10. HGRAPH0:     establishes Hercules graphics mode, clear page 0 only
  11. Source:      hgraph.asm ($herc.asm, hmode.asm)
  12.  
  13. Hercules or compatible required
  14. (including Hercules InColor)
  15.  
  16. Call with:   no parameters
  17. Returns:     if CF = 1, no Hercules installed
  18.              if CF = 0, AX = code for Hercules model
  19.              128 = HGC
  20.              144 = HGC+
  21.              208 = InC
  22. Uses:        AX, CX, CF
  23. Supports:    Hercules graphics cards and compatibles: graphics mode
  24.              see also Use64k in SYSTEM.DOC
  25. Example:     call    hgraph      ; establish graphics mode
  26.              jc      no_hercules ; drat!
  27.  
  28.  
  29. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  30.  
  31. HRAM8029:    establish an 80-column, 29-row RamFont mode, loading a
  32.              standard 8x12 character font in RAM
  33. Source:      hram8029.asm ($herc.asm, hmode.asm, $h8x12.asm, f8x12rle.asm,
  34.                            $rld.asm)
  35.  
  36. HRAM8043:    establish an 80-column, 43-row RamFont mode, loading a
  37.              standard 8x8 character font in RAM
  38. Source:      hram8043.asm ($herc.asm, hmode.asm, $h8x8.asm, f8x8.asm)
  39.  
  40. HRAM9025:    establish a 90-column, 25-row RamFont mode using
  41.              standard ROM characters
  42. Source:      hram9025.asm ($herc.asm, hmode.asm)
  43.  
  44. HRAM9029:    establish a 90-column, 29-row RamFont mode, loading a
  45.              standard 8x12 character font in RAM
  46. Source:      hram9029.asm ($herc.asm, hmode.asm, $h8x12.asm, f8x12lre.asm,
  47.                            $rld.asm)
  48.  
  49. HRAM9043:    establish a 90-column, 43-row RamFont mode, loading a
  50.              standard 8x8 character font in RAM
  51. Source:      hram9043.asm ($herc.asm, hmode.asm, $h8x8.asm, f8x8.asm)
  52.  
  53. Hercules RamFont card required
  54. (including Hercules InColor)
  55.  
  56. Note:        use htext to restore normal 80 x 25 text mode
  57.  
  58. Call with:   no parameters
  59. Returns:     if CF = 1, no RamFont card installed
  60.              if CF = 0, AX = code for Hercules model
  61.              144 = HGC+
  62.              208 = InC
  63. Uses:        AX, CF; all other flags and registers are saved
  64. Supports:    HGC+ and InC cards: 4k RamFont mode
  65. Example:     call  hram8043      ; RamFont mode: 80x43
  66.              jc    no_ramfont    ; drat!
  67.  
  68.  
  69. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  70.  
  71. HTEXT:       establish (or restore) Hercules text mode
  72. Source:      htext.asm ($herc, hmode)
  73.  
  74. Call with:   no parameters
  75. Returns:     if CF = 1, no Hercules installed
  76.              if CF = 0, AX = code for Hercules model
  77.              128 = HGC
  78.              144 = HGC+
  79.              208 = InC
  80. Uses:        AX, CF
  81. Supports:    Hercules graphics cards and compatibles: text mode
  82.              (including Hercules InColor)
  83. Example:     call  htext         ; Hercules text mode
  84.              jc    no_herc       ; drat!
  85.  
  86.  
  87. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  88.  
  89. MODECOLOR:   switches system to color text mode; may be used to switch
  90.              monitors on a 2-monitor system, or to switch to the standard
  91.              80-column, 25-rows color mode from other color modes
  92. Source:      mode.asm ($6845.asm)
  93.  
  94. Call with:   no parameters
  95. Returns:     CF = 1 if no color monitor
  96.              CF = 0 if successful
  97. Uses:        CF; all registers and all other flags are saved
  98. Example:     call  modecolor
  99.              jc    nocolor
  100.                 .
  101.                 .
  102.                 .
  103.  
  104.  
  105. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  106.  
  107. MODEMONO:    switches system to monochrome text mode; may be used either
  108.              to switch active monitors on a 2-monitor sysem or to switch
  109.              to monchrome text mode (80x25) from graphics mode (EGA or
  110.              Hercules).
  111. Source:      mode.asm ($6845.asm)
  112.  
  113. Call with:   no parameters
  114. Returns:     CF = 1 if no monochrome monitor
  115.              CF = 0 if successful
  116. Uses:        CF; all registers and all other flags are saved
  117. Example:     call  modemono
  118.              jc   nomono
  119.                 .
  120.                 .
  121.                 .
  122.  
  123.  
  124. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  125.  
  126. MODE43:      switch EGA to 80x43 text mode or VGA to 80x50 text mode
  127.              Mode43 switches an EGA to the 80-column, 43-row text mode from
  128.              any color mode or any EGA monochrome mode, or switches a color
  129.              VGA to 80x50 text mode from any other color mode.
  130. Source:      mode43.asm
  131.  
  132. Call with:   no parameters
  133. Returns:     if CF = 1, AX = 0 if no EGA or VGA in system
  134.                         AX = -1 if EGA connected to CGA monitor
  135.              if CF = 0, AX = 3 if EGA or VGA connected to color monitor
  136.                         AX = 7 if EGA or VGA connected to monochrome monitor
  137. Uses:        AX, CF; all other registers and flags are saved
  138. Example:     call  mode43
  139.              jc    noega
  140.  
  141.  
  142.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  143.  
  144. SVGA16:      set Super VGA 16-color graphics mode
  145. Source:      svga16.asm ($svga.asm, $banks.asm)
  146.  
  147. Call with:   AX = 16-color mode desired
  148.              AX = 0 for 800x600
  149.              AX = 1 for 1024x768
  150.  
  151.              ASMLIB's SVGA subroutines are derived from John Bridges'
  152.              public domain VGAKIT board identification and bank switching code.
  153.              Boards supported are:
  154.  
  155.              Ahead Technologies
  156.              ATI
  157.              Chips & Technologies
  158.              Everex
  159.              Genoa GVGA
  160.              NCR
  161.              Oak Technologies
  162.              Paradise (Western Digital)
  163.              Trident
  164.              Trident 8900
  165.              Tseng (Genoa, Orchid, Willow)
  166.              Tseng 4000
  167.              VESA standard
  168.              Video 7
  169.  
  170.              I have not been able to test VGAKIT modes on all boards; please
  171.              let me know if you encounter difficulties.
  172.  
  173. Returns:     if CF = 0, no error
  174.              if CF = 1, requested mode is not available
  175.              SVGA16 cannot determine if the monitor you are using will
  176.              work with the requested mode.  Monitor damage may result
  177.              from improper use of SVGA16.
  178.  
  179. Example:
  180.  
  181. include asm.inc
  182.  
  183. public  mygraph
  184. extrn   whichvga:proc, svga16:proc
  185.  
  186. .code
  187. mygraph proc
  188. ; I want to use a 16-color 1024x768 mode if available
  189. ; start by calling WhichVGA to determine if the equipment is capable
  190.         call   whichvga
  191.         or     ax,ax            ; SuperVGA installed?
  192.         jz     no_svga          ; nope, use some other mode
  193.         mov    ax,1             ; specify 1024x768 mode
  194.         call   svga16
  195.  
  196. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  197.  
  198. SVGA132:     switches supported systems to 132 column text mode
  199. Source:      svga132.asm ($sega.asm, $svga.asm)
  200.  
  201. Call with:   AX = screen rows code
  202.               AX = 0: 25 rows
  203.               AX = 1: 28-30 rows (depending on equipment)
  204.               AX = 2: 43 rows
  205.               AX = 3: 50 rows (depending on equipment)
  206.               AX = 4: 60 rows (depending on equipment)
  207.  
  208. Returns:     CF = 1 if mode not supported
  209.              if CF = 0, AX = mode number
  210. Uses:        AX, CF; all other registers and flags are saved
  211. Supports:    Equipment detected by IsSEVGA (see IsSEVGA in SYSTEM.DOC).
  212.              Most VGA boards require a multi-frequency monitor to use
  213.              132-column modes; consult your board's documentation.
  214.              EGA 132-column modes require at least an EGA monitor.
  215. Example:
  216.  
  217.         call  svga132        ; set mode
  218.         jc    no132          ; no good
  219.            .
  220.            .
  221.            .
  222.  
  223.  
  224.  
  225.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  226.  
  227. SVGA256:     set Super VGA 256-color graphics mode
  228. Source:      svga256.asm ($svga.asm, $banks.asm)
  229.  
  230. Call with:   AX = 256-color mode desired
  231.              AX = 0 for  640x400
  232.              AX = 1 for  640x480
  233.              AX = 2 for  800x600
  234.              AX = 3 for 1024x768
  235.  
  236.              ASMLIB's SVGA subroutines are derived from John Bridges'
  237.              public domain VGAKIT board identification and bank switching code.
  238.  
  239.              Equipment supported is listed under SVGA16, plus:
  240.  
  241.              Compaq (640x480 only)
  242.  
  243.  
  244. Returns:     if CF = 0, no error
  245.              if CF = 1, requested mode is not available
  246.              SVGA256 cannot determine if the monitor you are using will
  247.              work with the requested mode.  Monitor damage may result
  248.              from improper use of SVGA256.
  249.  
  250. Example:     see SVGA16
  251.  
  252.  
  253. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  254.  
  255. VGA13X:      changes standard VGA systems to undocumented 256-color graphics
  256.              modes.  ASMLIB graphics subroutines support 4 VGA13X modes
  257.              with up to 4 pages.  See also XMode.
  258.              VGA13X is based on public domain code from John Bridges and
  259.              Themie Gouthas.
  260. Source:      vga13x.asm (vga13x.inc, $graph.asm)
  261.  
  262. Call with:   AX = VGA13X mode number
  263.               0 = 320 x 200, 4 pages
  264.               1 = 320 x 240, 3 pages
  265.               2 = 320 x 400, 2 pages
  266.               3 = 360 x 480, 1 page
  267.              assumes DS:@data
  268. Returns:     nothing
  269. Uses:        nothing
  270. Supports:    VGA only: graphics mode
  271. Example:
  272.  
  273. include asm.inc
  274.  
  275. extrn   vga13x:proc
  276.  
  277. .code
  278. ; program fragment assumes DS:@data
  279.         .
  280.         .
  281.         .
  282.         call   getcrt
  283.         cmp    al,3
  284.         jne    oops                  ; do something else if no VGA
  285.         mov    ax,2                  ; 320 x 400, 2 pages
  286.         call   vga13x
  287.  
  288.  
  289.  
  290. ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  291.  
  292. XMODE16:     establish SuperEGA/SuperVGA graphics mode and configure
  293.              ASMLIB graphics subroutines to work with the mode.
  294. Source:      xmode16.asm ($graph.asm)
  295.  
  296. XMODE:       public byte in DGROUP; used to restore ASMLIB's default
  297.              configuration
  298. Source:      $graph.asm
  299.  
  300. Parameters:  maximum x, maximum y, registers as required to set mode.
  301.              XMode16 assumes that the mode is set with AH = 0.
  302. Returns:     nothing
  303. Uses:        All registers and flags saved.
  304. Supports:    16-color EGA/VGA-style graphics modes, up to 800 x 600 pixels.
  305.              Various equipment.  You must have the required equipment and
  306.              use the correct mode number;  hardware damage may result from
  307.              improper use of XMode16.  I cannot be held responsible for
  308.              damage resulting from use or misuse of XMode16.  Use XMode16
  309.              if your equipment is not supported by SVGA16.
  310.  
  311.              If 800 horizontal pixels are available, maxX% should be 799.
  312.              Similarly, if 600 vertical pixels are possible, maxY% should
  313.              be 599.
  314.  
  315.              Your graphics card manual lists mode numbers, monitor
  316.              requirements, and the number of horizontal and vertical
  317.              pixels corresponding to the mode.  Mode numbers are usually
  318.              in hex format.  Some modes and corresponding mode numbers
  319.              are listed on the next pages.
  320.  
  321.  
  322.  
  323.     Equipment            mode     mode number   Example
  324.  
  325.     Orchid ProDesigner   800x600        29h     mov   ax,799
  326.     STB EM/16                                   push  ax
  327.     Genoa                                       mov   ax,599
  328.     Sigma X16                                   push  ax
  329.     (Tseng chip set)                            mov   al,29h
  330.                                                 call  xmode16
  331.  
  332.  
  333.     Everex MED EGA       640X480   AL = 70h, BL = 00h
  334.     (Micro Enhancer Deluxe)
  335.                          752x410   AL = 70h, BL = 01h
  336.                                                 mov   ax,751
  337.                                                 push  ax
  338.                                                 mov   ax,409
  339.                                                 push  ax
  340.                                                 mov   al,70h
  341.                                                 mov   bl,01h
  342.                                                 call  xmode16
  343.  
  344.  
  345.     ATI VGA Wonder       800x600        54h     mov   ax,799
  346.                                                 push  ax
  347.                                                 mov   ax,599
  348.                                                 push  ax
  349.                                                 mov   al,54h
  350.                                                 call  xmode16
  351.  
  352.  
  353.     ATI VIP              800x560        53h     mov   ax,799
  354.                                                 push  ax
  355.                                                 mov   ax,559
  356.                                                 push  ax
  357.                                                 mov   al,53h
  358.                                                 call  xmode16
  359.  
  360. (continued)
  361.  
  362.     Paradise Plus-16     800x600        58h     mov   ax,799
  363.     Paradise Professional                       push  ax
  364.                                                 mov   ax,599
  365.                                                 push  ax
  366.                                                 mov   al,58h
  367.                                                 call  xmode16
  368.     
  369.  
  370.     Video 7 Fastwrite    800x600        62h     mov   ax,799
  371.     Video 7 VRAM                                push  ax
  372.                                                 mov   ax,599
  373.                                                 push  ax
  374.                                                 mov   al,62h
  375.                                                 call  xmode16
  376.  
  377.  
  378.     Western Digital      800x600   6Ah (color)  mov   ax,799
  379.                                    6Bh (mono)   push  ax
  380.     (VESA modes)                                mov   ax,599
  381.                                                 push  ax
  382.                                                 mov   al,6Ah   ; color
  383.                                                 call  xmode16
  384.     
  385.  
  386.     If any of this information conflicts with the specifications in your
  387.     video card's instruction manual, the manual's recommendation is a safer
  388.     bet.  Note that all the above modes require a multi-frequency monitor.
  389.  
  390.     When you're all done with Graphics mode, 
  391.  
  392.     CALL  ModeColor
  393.  
  394.     to return to 80x25 text mode, and
  395.  
  396.     MOV   XMode,0FFh
  397.  
  398.     to reset ASMLIB's graphics mode flags.
  399.  
  400.  
  401.  
  402.